home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d17 / pi11.arc / PI.DOC < prev   
Encoding:
Text File  |  1988-05-29  |  9.1 KB  |  198 lines

  1.                                     PI.DOC
  2.                                     ------
  3.                            Instructions for PI.COM
  4.                          Print Interceptor 1.1 (3/88)
  5.  
  6.                                (c)1988 E. Meyer
  7.  
  8.  
  9.      PI (Print Interceptor) is a printer utility for all MSDOS systems 
  10. (requires MS/PCDOS 2.x or higher).  When run, PI.COM becomes a memory resident 
  11. program that translates printer output according to a table that can be 
  12. changed at will.  Any outgoing ASCII code 00-FF can be redefined to another 
  13. code, or string of codes, to be sent to your printer.  This is a very general 
  14. approach, with many possible applications, including:
  15.  
  16.      * IBM extended (foreign) characters can be emulated on LQ printers
  17.  
  18.      * Single-character "Macros" can produce predefined strings
  19.  
  20.      * The same file can print differently on different printers
  21.  
  22.      * Printer output can be entirely suppressed
  23.  
  24.      PI allows you to change the current definitions in two ways: with a text 
  25. file full of definitions that you create; or with ESC codes that can be sent 
  26. from other programs.
  27.  
  28.  
  29.                               1. INSTALLING PI
  30.  
  31.      The PI.COM module, once installed, remains in memory until your computer 
  32. is reset.  There are two ways to install it.  First you may simply type:
  33.  
  34.                                  A>pi
  35.  
  36. This loads the module, but it is INACTIVE, and no redefinitions are in effect.  
  37. You would have to define some characters, then make PI active, before printer 
  38. output would be affected.  (See below for how to do this.)
  39.      Second, you may invoke PI with the name of a definition file:
  40.  
  41.                                  A>pi filename
  42.  
  43. This loads the module, makes it ACTIVE, and implements any redefinitions in 
  44. the file.  (See below for the required file format.)  In addition, this 
  45. command may be repeated any number of times to install a new definition file.
  46.  
  47.  
  48.                              2. DEFINITION FILES
  49.  
  50.      You can quickly establish a set of redefinitions for use with PI, using 
  51. any text editor.  Create a simple ASCII text file (say, MY.DEF), which you 
  52. will use with PI:
  53.                                  A>pi my.def
  54.  
  55. The file may contain any number of statements like this:
  56.  
  57.                                  128=67,8,44;
  58.  
  59. Numbers are always decimal; blank space and carriage returns are ignored.  PI 
  60. interprets the example shown as a request to define character 128 as the three- 
  61. byte sequence 67,8,44, and so on for each such statement in the file.  Any 
  62. characters not mentioned will be defined as themselves.  Finally, PI will be 
  63. made ACTIVE, enabling these definitions for use.
  64.  
  65.      The effect of the above example is to allow the IBM character capital-C- 
  66. sedilla to print as capital-C, backspace, comma, which is a good facsimile on 
  67. letter quality printers.  Of course, definitions can be a single byte: 
  68. "128=67;" would define it as capital-C alone.  And definitions can be empty: 
  69. "128=;" would define it as nothing, that is, a non-printing character.
  70.  
  71.      Each definition may be up to 32 bytes long, and PI has 6K (about 6000) 
  72. bytes available for all definitions.
  73.  
  74.  
  75.                               3. CONTROLLING PI
  76.  
  77.      If you just type "PI" with no arguments, you will be informed of the 
  78. current status (whether PI is active, and whether print output is enabled).  
  79. There is also a set of commands to change status:
  80.  
  81.               A>pi /a     Make PI ACTIVE
  82.               A>pi /i     Make PI INACTIVE
  83.  
  84.               A>pi /d     DISABLE print output
  85.               A>pi /e     ENABLE print output
  86.  
  87.      The "/D" command temporarily disables all output to the printer.  Your 
  88. software can operate as usual, thinking it's printing; but nothing will 
  89. happen, in fact there need not even be a printer present.  The current 
  90. definitions are not affected.
  91.  
  92.  
  93.                               4. PROGRAMMING PI
  94.  
  95.      You may never need to do anything further to control PI.  However, if you 
  96. do find a need, or become interested, PI responds to a set of ESC-commands, 
  97. just like those that control your printer.  You can install these commands in 
  98. your word processor's printer controls section; put a set of them in a disk 
  99. file to be COPYed to the printer for use; or use them in a program of your 
  100. own, for example, to read in translation tables in some format other than that 
  101. expected by PI.COM itself.
  102.  
  103.      When PI is "active", it is translating printer output according to any 
  104. currently installed definitions.  When it is "inactive", all output goes 
  105. direct to the printer without translation.  Keep these two states in mind: 
  106. making PI inactive and defining every character as itself are NOT the same.
  107.  
  108.      Once again, after PI.COM is installed, these codes must be PRINTED to 
  109. modify its behavior.  Hexadecimal notation is used throughout here; decimal 
  110. values are often shown in parentheses.  Hex 1B is the ESCape code (27 decimal).
  111.  
  112. PI INACTIVE.                   1B FF 30    (27,255,48)
  113.          This sequence temporarily "turns PI off", if you ever need a 
  114.       quick way to suspend translation.
  115.  
  116. PI ACTIVE.                     1B FF 31    (27,255,49)
  117.          This sequence "turns PI on", enabling its translation of 
  118.       outgoing printer data according to any installed definitions.
  119.  
  120. SET STANDARD ASCII.            1B FF 32    (27,255,50)
  121.          This sequence defines every character as itself; useful as a 
  122.       starting point for further modifications.
  123.  
  124. MASK PARITY.                   1B FF 33    (27,255,51)
  125.          This sequence defines ASCII 00-7F (0-127) as themselves, and 
  126.       ASCII 80-FF (128-255) as 00-7F (0-127) also.  Effectively, this 
  127.       would "mask off" the high, or parity, bit on outgoing data.
  128.  
  129. ERASE DEFINITIONS.             1B FF 34    (27,255,52)
  130.          This sequence wipes out all ASCII codes, defining each as a 
  131.       null string.  Only subsequently redefined codes will print.
  132.  
  133. REDEFINE CODE.                 1B FE aa nn b1 b2...  (27,254,aa,nn,b1...)
  134.          This sequence redefines any ASCII code "aa", for printing 
  135.       purposes, as a string of "nn" bytes, "b1 b2...".
  136.  
  137.  
  138.                               5. ABOUT CONFLICTS
  139.  
  140.      PI uses just two uncommon ESC codes, which probably will not conflict 
  141. directly with anything in your printer's command set.  A more subtle problem 
  142. is that PI might interfere with your use of printer ESC codes by attempting to 
  143. translate them!  PI tries to avoid this: it will never translate an ESC, nor a 
  144. byte preceded by an ESC, so that, for example, if you use an ESC-E command it 
  145. will not be affected by any translation of the character "E".  But many 
  146. printer sequences are longer than two bytes, and in these cases PI can't 
  147. distinguish commands from data.
  148.  
  149.      To illustrate the problem, suppose you have been using the printer 
  150. command ESC-r-nn, "1B 72 80" (27,114,128) to set the right margin to absolute 
  151. column 128.  If this occurs while PI is ACTIVE, with the redefinition in the 
  152. example above, that final "128" is going to turn into "67,8,44" or whatever, 
  153. resulting in setting a margin at column 67, plus some garbage.  This is why 
  154. you (may?) need to ensure that PI is INACTIVE when (some?) printer commands 
  155. are being sent.  There are two possible approaches.
  156.  
  157.      THE FAST AND LOOSE METHOD: in general, leave PI ACTIVE and don't worry; 
  158. you may never see a problem.  But whenever you see that your printer isn't 
  159. being properly set up, or spot a particular command that you know will cause 
  160. trouble (because it contains ASCII codes that you have redefined), make sure 
  161. it is "bracketed" somehow by commands to turn off translation:
  162.                  1B FF 30        ;make PI INACTIVE
  163.                  1B 72 80        ;now set the margin correctly
  164.                  1B FF 31        ;make PI ACTIVE again
  165. Often this approach will be adequate, particularly if you seldom redefine any 
  166. characters in the normal ASCII range 00-7F.
  167.  
  168.      THE CAUTIOUS METHOD: in general, make PI INACTIVE.  But in every text 
  169. file you are going to print, embed the PI ON command (1B FF 31) at the 
  170. beginning, and PI OFF (1B FF 30) at the end.  
  171.  
  172.  
  173.  
  174.  
  175.                                TECHNICAL NOTES
  176.  
  177.      PI is a replacement interrupt handler.  Because it operates at this 
  178. "lowest" level, it will intercept ALL printer output regardless of its origin 
  179. (redirection, etc).
  180.      Because PI is a Terminate and Stay Resident (TSR) utility, once installed 
  181. it cannot be removed without a reset.  You should not install PI from within a 
  182. DOS shell while executing another program, as this will corrupt the DOS memory 
  183. allocations; other uses of PI.COM (reading files, etc) cause no problems in 
  184. this situation.
  185.  
  186.  
  187.  
  188.      PI and its documentation are (c)1988 E.Meyer, all rights reserved.  
  189. They may be freely distributed, but not modified or sold for profit without 
  190. my written consent.  The user takes full responsibility for any damages 
  191. resulting from the use (or misuse) of this program.  Please report any 
  192. problems encountered.
  193.  
  194.                  Eric Meyer
  195.             427 N. Washington #4             CompuServe [74415,1305]
  196.            Bloomington, IN  47401
  197.  
  198.